<!DOCTYPE html>
<html lang="en" ng-app="todo">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Node/Angular Todo App</title>
	<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
  <style>
    body {
      padding-top: 50px;
    }
  </style>
  <script src="/node_modules/angular/angular.js"></script>
  <script src="/node_modules/angular-route/angular-route.js"></script>
  <!-- powered by express -->
  <!-- <script src="core.js"></script> -->
  <!-- powered by koa -->
  <!-- <script src="todo.js"></script> -->
  <script src="js/controllers/main.js"></script>
  <script src="js/services/todo.js"></script>
  <script src="js/core.js"></script>
</head>
<body ng-controller="MainController">
  <div class="container">
    <div class="jumbotron text-center">
      <h1>I'm a todo-aholic <span class="label label-info">{{ todos.length }}</span></h1>
    </div>

    <div id="todo-list" class="row">
      <div class="col-sm-4 col-sm-offset-4">
        <div class="checkbox" ng-repeat="todo in todos">
          <button class="btn btn-danger btn-xs" ng-click="updateTodo(todo._id)"><a href="#/todos/{{todo._id}}/edit"><i class="glyphicon glyphicon-pencil"></i></a></button>
          <button class="btn btn-danger btn-xs" ng-click="deleteTodo(todo._id)"><i class="glyphicon glyphicon-remove"></i></button>
          -
          <label>
            <input type="checkbox" ng-checked="todo.done" ng-click="toggleDone(todo._id)"> {{ todo.text }}
          </label>
        </div>
      </div>
    </div>

    <div id="todo-form" class="row">
      <div class="col-sm-8 col-sm-offset-2 text-center">
        <form>
          <div class="form-group">
            <input type="text" placeholder="Your new todo" class="form-control input-lg" ng-model="formData.text">
          </div>
          <div class="alert alert-danger" role="alert" ng-hide="!errMsg">{{ errMsg }}</div>
          <button type="submit" class="btn btn-primary btn-lg" ng-click="createTodo()">Add</button>
        </form>
      </div>
    </div>
  </div>
</body>
</html>